package com.googlecode.openauth.web.entity;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

import org.apache.commons.lang.StringUtils;

/**
 * 瑙掕壊瀹炰綋绫�
 * @author Administrator
 *
 */
@Deprecated
public class Role {

	private int roleId;
	private String uuid;
	private String roleName;
	private String roleDesc;
	private int createUserId;
	private Timestamp createDate;
	private Timestamp updateDate;
	private int parent;
	private List<ActionInfo> roleAction = new ArrayList<ActionInfo>();
	private List<ResourceInfo> roleRes = new ArrayList<ResourceInfo>();
	private List<AreaInfo> roleArea = new ArrayList<AreaInfo>();
	public Role() {
		super();
		uuid = UUID.randomUUID().toString();
	}
	
	public int getParent() {
		return parent;
	}

	public void setParent(int parent) {
		this.parent = parent;
	}

	public int getRoleId() {
		return roleId;
	}
	public void setRoleId(int roleId) {
		this.roleId = roleId;
	}
	public String getUuid() {
		return uuid;
	}
	public void setUuid(String uuid) {
		this.uuid = uuid;
	}
	public String getRoleName() {
		return roleName;
	}
	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}
	public String getRoleDesc() {
		return roleDesc;
	}
	public void setRoleDesc(String roleDesc) {
		this.roleDesc = roleDesc;
	}
	public int getCreateUserId() {
		return createUserId;
	}
	public void setCreateUserId(int createUserId) {
		this.createUserId = createUserId;
	}
	public Timestamp getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Timestamp createDate) {
		this.createDate = createDate;
	}
	public Timestamp getUpdateDate() {
		return updateDate;
	}
	public void setUpdateDate(Timestamp updateDate) {
		this.updateDate = updateDate;
	}
	public List<ActionInfo> getRoleAction() {
		return roleAction;
	}
	public void setRoleAction(List<ActionInfo> roleAction) {
		this.roleAction = roleAction;
	}
	public List<ResourceInfo> getRoleRes() {
		return roleRes;
	}
	public void setRoleRes(List<ResourceInfo> roleRes) {
		this.roleRes = roleRes;
	}
	public List<AreaInfo> getRoleArea() {
		return roleArea;
	}
	public void setRoleArea(List<AreaInfo> roleArea) {
		this.roleArea = roleArea;
	}
	
	public String toString(){
		StringBuilder builder = new StringBuilder();
		builder.append(" role id");
		builder.append(roleId);
		
		if(!StringUtils.isEmpty(roleName)){
			builder.append(" role name : ");
			builder.append(roleName);
		}
		
		if(!StringUtils.isEmpty(uuid)){
			builder.append(" uuid :  ");
			builder.append(uuid);
		}
		
		if(!StringUtils.isEmpty(roleDesc)){
			builder.append(" roleDesc :  ");
			builder.append(roleDesc);
		}
		
		if(createDate != null){
			builder.append(" createDate :  ");
			builder.append(createDate);
		}
		
		if(updateDate != null){
			builder.append(" updateDate :  ");
			builder.append(updateDate);
		}
		
		if(getRoleAction() != null && !getRoleAction().isEmpty()){
			builder.append(" roleAction :  ");
			builder.append(roleAction);
		}
		if(getRoleRes() != null && !getRoleRes().isEmpty()) {
			builder.append(" roleRes :  ");
			builder.append(roleRes);
		}
		if(getRoleArea() != null && !getRoleArea().isEmpty()) {
			builder.append(" roleArea :  ");
			builder.append(roleArea);
		}
		return builder.toString();
	}
	
	
	
}
